CREATE SEQUENCE SIGIN.DOCUMENTOBORRADO_SEQ
START WITH 1
INCREMENT BY 1
MINVALUE 0
NOCACHE 
NOCYCLE 
NOORDER;

CREATE OR REPLACE TRIGGER SET_DOCUMENTOBORRADO_ID
   BEFORE INSERT
   ON DOCUMENTOBORRADO
   REFERENCING NEW AS NEW OLD AS OLD
   FOR EACH ROW
DECLARE
   tmpvar   NUMBER;
BEGIN
   tmpvar := 0;

   SELECT DOCUMENTOBORRADO_SEQ.NEXTVAL
     INTO tmpvar
     FROM DUAL;

   :NEW.iddocumentoborrado := tmpvar;
END SET_DOCUMENTOBORRADO_ID;